
<%--
  This logout page will redirect the user back to the home page.
  The redirect is required to prevent the user from seeing a 'Logged In' message, even
  when they are in fact already logged out.   
--%>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<%@ taglib uri="http://java.sun.com/jsf/core" prefix="f" %>
<%@ taglib uri="http://java.sun.com/jsf/html" prefix="h" %>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<%@ page session="false" %>
<f:view>
    <html>


    <head>

        <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
        <title>TestFire</title>
        <jsp:useBean id="nav" class="org.testfire.realm.control.NavBean"/>
        
        <link rel=stylesheet href="${nav.href_css_basic}" type="text/css">
        <script type="text/javascript" src="${nav.href_js_displayTools}"></script>

    </head>
    <body>
    <c:redirect url="${nav.href_home}"/>
    <div id="masthead">
        <h1 id="siteName">TestFire</h1>

        <div id="globalNav">
            <h:form>
                <a id="href_home" href="${nav.href_home}">Home</a> |
                <c:choose>
                    <c:when test="${pageContext.request.userPrincipal.name != null}">

                        <h:commandLink id="logout" action="nav_logout" actionListener="#{UserBean.userLogout}">
                            <h:outputText value="Log Out |"/>
                        </h:commandLink>

                    </c:when>
                    <c:otherwise>
                        <a id="href_account" href="${nav.href_account}">Log In</a> |
                    </c:otherwise>
                </c:choose>
            </h:form>
        </div>
    </div>


    <!-- end masthead -->

    <div id="content">

        <div class="content_div">
            <h3>You have been logged out.</h3>

            <h3>You should be forwarded to the home page: <a href="http://localhost:8080">your_home_page.com</a>
            </h3>
        </div>
       
        <!-- end content edit -->
    </div>
    <!-- end content -->
    </body>
    </html>
</f:view>